<?php

namespace App\Http\Requests\Api\v1;

use Illuminate\Foundation\Http\FormRequest;

class PayPasswordByoldRequest extends FormRequest
{
    public function rules(): array
    {
        $rule = [];
        switch ($this->method()) {
            case 'PUT':
            case 'POST':
                $rule = [
                    'password' => 'required|confirmed|digits:6',
                    'password_confirmation' => 'required|same:password',
                ];
                break;
        }
        return $rule;
    }
}
